class Actor {
  Act() {
    console.log('开始演出')
  }
}

// 造型师
class Stylist extends Actor {
  protected actor: Actor

  // 对类进行装饰
  MakeUp(actor: Actor) {
    this.actor = actor
  }

  Act() {
    if (null !== this.actor) {
      this.actor.Act()
    }
  }
}

// 古装造型师
class AncientStylist extends Stylist {
  private ShowRole() {
    console.log('演员即将表演古装剧')
  }

  private MakeUpForActor() {
    console.log('给演员古代化妆')
  }

  Act() {
    this.ShowRole()
    this.MakeUpForActor()
    super.Act()
  }
}

// 现代造型师
class ModerStylist extends Stylist {
  private ShowRole() {
    console.log('演员即将表演都市剧')
  }

  private MakeUpForActor() {
    console.log('给演员化妆，穿搭西装')
  }

  Act() {
    this.ShowRole()
    this.MakeUpForActor()
    super.Act()
  }
}

(function () {
  let actor = new Actor()

  let moderStylist = new ModerStylist()
  let ancientStylist = new AncientStylist()

  moderStylist.MakeUp(actor)
  moderStylist.Act()

  ancientStylist.MakeUp(actor)
  ancientStylist.Act()
}())